import SpinLoading from '@/components/SpinLoading/SpinLoading'
import {  Suspense } from 'react'

/**
 * 组件懒加载，结合Suspense实现
 * @param Component 组件对象
 * @returns 返回新组件
 */
const LazyLoading = (Component: React.ComponentType) => {
  return (
    <Suspense fallback={<SpinLoading />}>
      <Component />
    </Suspense>
  )
}

export default LazyLoading